import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsArray, IsOptional } from 'class-validator';

export class CreateCoffeeDto {
  @ApiProperty({ example: '猫屎咖啡', description: '咖啡名称' })
  @IsString()
  name: string;

  @ApiProperty({
    example: ['浓郁', '香甜'],
    description: '咖啡风味',
    type: [String],
  })
  @IsArray()
  @IsString({ each: true })
  flavors: string[];

  @ApiProperty({
    example: '由猫咪精心挑选的咖啡豆制成',
    description: '咖啡描述',
    required: false,
  })
  @IsString()
  @IsOptional()
  description?: string;
}
